<%@ page pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.base.DatabaseObject"%>
<%@page import="com.base.DatabaseDAO"%>
<%@page import="com.base.Config"%>
<%@page import="java.math.BigDecimal"%>
<%@page import="com.utils.LOBs"%>
<%@page import="java.sql.Clob"%>

<%@include file="inc-header.jsp"%><!-- MAIN CONTENT -->
<div class="box bottom10">
	<%@include file="inc-nav-header.jsp"%>
	<%
	String sId = Utils.getParam(request, "id", "41");
	String sPage = Utils.getParam(request, "page", "1");
	DatabaseObject weather = contentDAO.getWeather(new BigDecimal(sId));
	//int currPage = Integer.parseInt(sPage);
	//int rowsPerPage = 7;
	%>
	<div class="tab2">
		<%@include file="dichvu-adv.jsp" %> >>
		<a href="weather.jsp?act=dv">Thời tiết</a> >>
		<a href="weather.jsp?id=<%=weather.getAttribute().get("id") %>" class="active"> <%=weather.getAttribute().get("alias") %></a>
	</div>
	<!--end .tab2-->
	<!-- BODY CONTENT -->
	<div class="box clearfix">

		<div class="table">
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tbody>
				<tr>
						<td width="4%"><a href="href="weather.jsp??act=dv&id=<%=weather.getAttribute().get("id") %>&page=<%=sPage %>""></a></td>
		                <td width="96%" class="text-left">
		                    <h2 class="clearfix"><a href="#" class="f1"> <strong> <%=weather.getAttribute().get("alias") %> </strong></a></h2>
		                </td>
		            </tr>
		        </tbody>
		    </table>
		</div><!--end .table-->
		<div class="box-cont">
		    <p class="MsoNormal" style="text-align: justify; line-height: normal;">
		        <span style="font-size: 10pt; font-family: Arial,sans-serif">
		            <%=weather.getAttribute().get("content") == null?"":LOBs.readClob((Clob)weather.getAttribute().get("content")).replaceAll("\n", "<br/>")%>
		        </span>
		    </p>  
		</div><!--end .box-cont-->
	</div>
	<div class="box clearfix">
		<div class="title">
			<h3>
				<strong>Các khu vực</strong>
			</h3>
			<%
		if (!StringTool.isEmptyOrNul(sId)) {
			ArrayList<DatabaseObject> weatherList = contentDAO.getListWeather();
			for (DatabaseObject weat : weatherList) {%>
			<li>
				<img src="images/icon-list.png" alt="">
				<a href="weather.jsp?id=<%=weat.getAttribute().get("id") %>"> <%=weat.getAttribute().get("alias") %> </a>
			</li>
		<%}}%>			
		</div>
	</div>

	<!-- END BODY CONTENT -->
</div>
<!--end .box bottom10-->
<%@include file="inc-nav-bottom.jsp"%>
<!-- END MAIN CONTENT -->
<%@include file="inc-footter.jsp"%>
